using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Hydrology
{
    /// <summary>
    /// <para>Flow Length</para>
    /// <para>Calculates the upstream or downstream distance, or weighted distance, along the flow path for each cell.</para>
    /// <para>计算每个像元沿流路的上游或下游距离或加权距离。</para>
    /// </summary>    
    [DisplayName("Flow Length")]
    public class FlowLength : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FlowLength()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_flow_direction_raster">
        /// <para>Input flow direction raster</para>
        /// <para><xdoc>
        ///   <para>The input raster that shows the direction of flow out of each cell.</para>
        ///   <para>The flow direction raster can be created using the Flow Direction tool.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>显示流出每个像元的方向的输入栅格。</para>
        ///   <para>可以使用流向工具创建流向栅格。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para>The output raster that shows for each cell the upstream or downstream distance along a flow path.</para>
        /// <para>输出栅格，用于显示每个像元沿流路径的上游或下游距离。</para>
        /// </param>
        public FlowLength(object _in_flow_direction_raster, object _out_raster)
        {
            this._in_flow_direction_raster = _in_flow_direction_raster;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Flow Length";

        public override string CallName => "sa.FlowLength";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "configKeyword", "extent", "geographicTransformations", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_flow_direction_raster, _out_raster, _direction_measurement.GetGPValue(), _in_weight_raster];

        /// <summary>
        /// <para>Input flow direction raster</para>
        /// <para><xdoc>
        ///   <para>The input raster that shows the direction of flow out of each cell.</para>
        ///   <para>The flow direction raster can be created using the Flow Direction tool.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>显示流出每个像元的方向的输入栅格。</para>
        ///   <para>可以使用流向工具创建流向栅格。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input flow direction raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_flow_direction_raster { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output raster that shows for each cell the upstream or downstream distance along a flow path.</para>
        /// <para>输出栅格，用于显示每个像元沿流路径的上游或下游距离。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Direction of measurement</para>
        /// <para><xdoc>
        ///   <para>The direction of measurement along the flow path.</para>
        ///   <bulletList>
        ///     <bullet_item>Downstream—Calculates the downslope distance along the flow path, from each cell to a sink or outlet on the edge of the raster.</bullet_item><para/>
        ///     <bullet_item>Upstream—Calculates the longest upslope distance along the flow path, from each cell to the top of the drainage divide.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>沿流路的测量方向。</para>
        ///   <bulletList>
        ///     <bullet_item>下游 - 计算沿流路径的下坡距离，从每个像元到栅格边缘的汇点或出口。</bullet_item><para/>
        ///     <bullet_item>上游 - 计算沿流道从每个像元到排水分水岭顶部的最长上坡距离。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Direction of measurement")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _direction_measurement_value _direction_measurement { get; set; } = _direction_measurement_value._DOWNSTREAM;

        public enum _direction_measurement_value
        {
            /// <summary>
            /// <para>Downstream</para>
            /// <para>Downstream—Calculates the downslope distance along the flow path, from each cell to a sink or outlet on the edge of the raster.</para>
            /// <para>下游 - 计算沿流路径的下坡距离，从每个像元到栅格边缘的汇点或出口。</para>
            /// </summary>
            [Description("Downstream")]
            [GPEnumValue("DOWNSTREAM")]
            _DOWNSTREAM,

            /// <summary>
            /// <para>Upstream</para>
            /// <para>Upstream—Calculates the longest upslope distance along the flow path, from each cell to the top of the drainage divide.</para>
            /// <para>上游 - 计算沿流道从每个像元到排水分水岭顶部的最长上坡距离。</para>
            /// </summary>
            [Description("Upstream")]
            [GPEnumValue("UPSTREAM")]
            _UPSTREAM,

        }

        /// <summary>
        /// <para>Input weight raster</para>
        /// <para><xdoc>
        ///   <para>An optional input raster for applying a weight to each cell.</para>
        ///   <para>If no weight raster is specified, a default weight of 1 will be applied to each cell. For each cell in the output raster, the result will be the number of cells that flow into it.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于对每个像元应用权重的可选输入栅格。</para>
        ///   <para>如果未指定权重栅格，则默认权重 1 将应用于每个像元。对于输出栅格中的每个像元，结果将是流入其中的像元数。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input weight raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_weight_raster { get; set; } = null;


        public FlowLength SetEnv(int? autoCommit = null, object cellSize = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}